<?php

namespace app\api\controller;

use think\Controller;
use think\Request;
use app\api\model\Cates;

class Category extends Controller
{
    //list列表
    public function findAll(Request $request) {
        $cates = Cates::field('id, name, parent_id as parentId, is_parent as isParent, sort')
                    ->where('parent_id', $request->pid)
                    ->select();
        return json($cates);
    }
}
